<?php
include('../db_connect.php');

$unban_user=true;

if($_POST["unbanID"] == "" || !is_numeric($_POST['unbanID'])){
	$unban_user=false;
    echo "Sorry, could not validate Facebook ID.";
    return;
}

$facebookID=$_POST['unbanID'];


//make sure this facebook id does already exist
$sql="select user_id from fb_users where user_id='$facebookID'";
$result2= $db->Execute($sql);
if(!$result2->fields['user_id'])
{
    $unban_user=false;
    echo "Sorry, this Facebook ID does not exist.";
    return;
}
//we are validated, update user as unbanned 
if($unban_user){
    $sql="update fb_users set banned=0 where user_id=$facebookID";
    $db->Execute($sql);
    echo "Success! Facebook user $facebookID has been unbanned.";

}

?>
